﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShopOnline.DAL;

namespace ShopOnline.BLL
{
    public class BCCard : _BCCard
    {
        public enum StatusCard
        {
            Draft = 1,
            Submitted = 2,
            Initiated = 3,
            Cancelled = 4,
            Successed = 5,
            Closed = 6
        }

        public enum BorderStyle
        {
            Normal = 1,
            RadiusAll = 2,
            RadiusLeftRight1 = 3,
            RadiusLeftRight2 = 4
        }

        public static BCCard GetCardByID(int ID)
        {
            try
            {
                BCCard card = new BCCard();
                card.LoadByPrimaryKey(ID);
                return card;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }

        public static BCCard GetMyCards(int customerID)
        {
            try
            {
                BCCard listCard = new BCCard();
                listCard.Where.CustomerID.Value = customerID;
                listCard.Query.Load();
                return listCard;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }

        public static BCCard GetTemplateCards()
        {
            try
            {
                BCCard listCard = new BCCard();
                listCard.Where.IsTemplate.Value = true;
                listCard.Query.Load();
                return listCard;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
    }
}
